 class FailPanel extends egret.Sprite
    {
    	private tap_textfeild : egret.TextField;
    	private rank_textfeild : egret.TextField;
    	private beat_textfeild : egret.TextField;
    	private title_textfeild : egret.TextField;
        private share_btn:egret.Bitmap;
        private replay_btn:egret.Bitmap;
        private yoffset :number;
        private yofftop :number;
    	public constructor() {
            super();
            this.yoffset = 288 + Main.stageH * 0.64;
            this.yoffset = this.yoffset > 800 ? 800 : this.yoffset;
            this.yofftop = 288 - Main.stageH * 0.36;
            this.yofftop = this.yofftop < 0 ? 0 : this.yofftop;
            this.height = 800;
            var bg = this.createBitmapByName("failed_bg");//开始按钮
            bg.y = this.yofftop + (Main.stageH - 625)/2 + 20;
            bg.x = 60;
            this.tap_textfeild= new egret.TextField();
	        this.tap_textfeild.width = 400;
	        this.tap_textfeild.textColor = 0xff0000;
        	this.tap_textfeild.textAlign = egret.HorizontalAlign.CENTER;
	        this.tap_textfeild.text = "没有管住你的败家娘们~";
	        this.tap_textfeild.size = 22;
	        this.tap_textfeild.x =80;
	        this.tap_textfeild.y = bg.y + 190;

	        this.rank_textfeild= new egret.TextField();
	        this.rank_textfeild.width = 400;
	        this.rank_textfeild.textColor = 0xffffff;
        	this.rank_textfeild.textAlign = egret.HorizontalAlign.CENTER;
	        this.rank_textfeild.text = "哈哈哈！！！";
	        this.rank_textfeild.size = 22;
        	this.rank_textfeild.strokeColor = 0x000000;
        	this.rank_textfeild.stroke = 2;
	        this.rank_textfeild.x = 80;
	        this.rank_textfeild.y = this.tap_textfeild.y + 40;


	        this.share_btn = this.createBitmapByName("share_btn");//开始按钮
            this.share_btn.x = 70
            this.share_btn.y = bg.height + 20 + bg.y;
            this.share_btn.touchEnabled = true;//开启触碰
            this.share_btn.addEventListener(egret.TouchEvent.TOUCH_TAP,this.doShare,this);//点击按钮开始游戏
            
	        this.replay_btn = this.createBitmapByName("replay_btn");//开始按钮
            this.replay_btn.x = 280
            this.replay_btn.y = bg.height + 20 + bg.y;
            this.replay_btn.touchEnabled = true;//开启触碰
            this.replay_btn.addEventListener(egret.TouchEvent.TOUCH_TAP,this.doRepaly,this);//点击按钮开始游戏

            this.addChild(bg);
	        this.addChild(this.tap_textfeild);
	        this.addChild(this.rank_textfeild);
	        this.addChild(this.share_btn);
	        this.addChild(this.replay_btn);
        }

        public score(n : number){
        	this.tap_textfeild.text = "败家娘们，不怕累！！！";
        }

        public doShare(evt:egret.TouchEvent):void{
      		this.dispatchEventWith("shareEvent");
        }

        public doRepaly(evt:egret.TouchEvent):void{
      		this.dispatchEventWith("replayEvent");
        }

        private createBitmapByName(name:string):egret.Bitmap {
            var result:egret.Bitmap = new egret.Bitmap();
            var texture:egret.Texture = RES.getRes(name);
            result.texture = texture;
            return result;
        }
    }